<div id="content">
	<div class="row s_page_title">
		<sa-big-breadcrumbs [items]="['项目管理','预约维修[小程序]','预约记录[司机]']" icon="fa fa-smile-o"
			class="col-xs-12 col-sm-7 col-md-7 col-lg-4"></sa-big-breadcrumbs>
	</div>
	<sa-widgets-grid>
		<div class="s_table">
			<div sa-widget [editbutton]="false" color="darken" class="clearfix">
				<header><span class="widget-icon"> <i class="fa fa-table"></i> </span>
					<h2>预约记录[司机]</h2>
				</header>
				<div>
					<div class="widget-body no-padding">
						<div class="page-header clearfix s_table_opreation">
							<div class="left page-header-btn" style="width: calc(100% - 230px);">
								<div class="top_module">
									<span class="module_text">维修点</span>
									<div class="s_hover_box">
										<select class="select2" id="repairPointSelect2">
											<option value=''></option>
										</select>
										<div class="s_del_icon" (click)='delRepairPoint()'>x</div>
									</div>
								</div>

								<div class="top_module">
									<span class="module_text">车牌号码
									</span>
									<div class="s_hover_box">
										<select class="select2" id="carNumberSelect2">
											<option value=''></option>
										</select>
										<div class="s_del_icon" (click)='del_carNumber()'>x</div>
									</div>
								</div>

								<!-- <div class="top_module top_module_box">
									<span class="top_module_label module_text">手机号码</span>
									<input class="module_inp" [(ngModel)]="tableParam.phone" type="text" placeholder="请输入手机号码"/>
								</div> -->

								<div class="selectDate top_module">
									<table-select-date [notInit]='true' (outerTime)="getSelectTableTime($event)"></table-select-date>
								</div>

								<div class="top_module top_module_box">
									<span class="top_module_label module_text">状态</span>
									<select name="" class="top_module_select" [(ngModel)]="tableParam.status">
										<option value="">全部</option>
										<option value="1">已取消</option>
										<option value="2">已维修</option>
										<option value="3">待维修</option>
										<option value="4">已过期</option>
										<!-- <option value="5">已核销</option> -->
									</select>
								</div>

								<button class="btn btn-primary" (click)="tableSearch()">查询</button>
							</div>
							<div class="right top-search">
								<input type="text" [(ngModel)]="tableParam.searchKey" (change)="tableSearch()" class="search-input"
									placeholder="维修点/预约人/手机号码/车牌号码">
								<span class="top-search-box">
									<button class="top-search-btn" type="button" (click)="tableSearch()"> <i
											class="fa fa-search"></i></button>
								</span>
							</div>
						</div>
						<div class="table_scroll">
							<table
								class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table">
								<thead>
									<tr>
										<th>小程序名称</th>
										<th>维修点名称</th>
										<th>车牌号码</th>
										<th>公司名称</th>
										<th>手机号码</th>
										<th>预约人</th>
										<th>状态</th>
										<th>开始时间</th>
										<th>结束时间</th>
										<th>核销时间</th>
										<th *ngIf="isShowDelete">操作</th>
									</tr>
								</thead>
								<tbody>
									<tr *ngFor="let row of tableData">
										<td>{{row.appletsCode=='0004'?'随身修':'随你运'}}</td>
										<td>{{row.repairPointName}}<span *ngIf="row.repairPointName==''" style="color:#8e8f91"> 暂无</span>
										</td>
										<td>{{row.carNumber}}</td>
										<td>{{row.companyName}}</td>
										<td>{{row.phone}}</td>
										<td>{{row.userName}}</td>
										<td>
											<span *ngIf="row.status == '1'" style="color: #8e8f91">已取消</span>
											<span *ngIf="row.status == '2'" style="color: #418f02">已维修</span>
											<span *ngIf="row.status == '3'" style="color: #6ea1f7">待维修</span>
											<span *ngIf="row.status == '4'" style="color: #FF0000">已过期</span>
											<span *ngIf="row.status == '5'" style="color: #6ea1f7">已核销</span>
											<button *ngIf="row.status == '2' && row.repairedUser" type="button"
												(click)="tablelook(row,problemModal)" style="margin-left: 10px;">查看</button>
										</td>
										<td>{{row.startTime}}</td>
										<td>{{row.endTime}}</td>
										<td>{{row.activationTime ? row.activationTime: '-'}}</td>
										<td *ngIf="isShowDelete">
											<button type="button" (click)="deleteRow(row)">删除</button>
										</td>
									</tr>
								</tbody>
							</table>
						</div>
						<div class="table-fix clearfix">
							<paginator [totalRecords]="totalCount" [rows]="pageSize" [currentPage]="curPage - 1"
								(onPageChange)="paginate($event)">
							</paginator>
							<button type="button" class="btn default refresh_btn" (click)="refresh()"><i
									class="fa fa-refresh"></i></button>
						</div>
					</div>
				</div>
			</div>
		</div>
		<!-- 查看维修记录 -->
		<div bsModal #problemModal="bs-modal" id="problemModal" class="modal fade" tabindex="-1" role="dialog"
			aria-labelledby="myLargeModalLabel" aria-hidden="true">
			<div class="modal-dialog modal-lg" style="width: 800px;">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" (click)="cancelProblemModal(problemModal)" aria-label="Close"><span
								aria-hidden="true">&times;</span></button>
						<h4 class="modal-title">查看维修记录</h4>
					</div>
					<div class="modal-body" style="padding: 15px 15px 30px 15px">
						<div class="table_scroll">
							<table
								class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table">
								<thead>
									<tr>
										<th>维修人</th>
										<th>维修时间</th>
										<!-- <th>维修前设备检测故障信息</th>
										<th>维修内容</th> -->
									</tr>
								</thead>
								<tbody>

									<tr *ngFor="let item of ProblemModalTableData">
										<td>{{item.repairedUser}}</td>
										<td>{{item.repairedTime}}</td>
										<!-- <td>{{item.exceptionName}}</td>
										<td>
											<div *ngIf="item.repairedRecords">
												<span>{{item.repairedRecords}}</span>
											</div>
										</td> -->
									</tr>
								</tbody>
							</table>
						</div>
					</div>
				</div>
			</div>
		</div>
		<!-- 查看维修记录 end-->
	</sa-widgets-grid>
</div>